package com.bjdd.jdy.entity;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.io.Serializable;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/4/18.
 */

public class OrderBean implements Serializable{
    private boolean isTake = false;
    /**
     * orderId : 19
     * userId : 7
     * remark :
     * orderNo : 855219652710764544
     * orderStatus : 1
     * timeOut : false
     * city : {"cityId":1,"cityName":"福州市","cityCode":"3501","enable":true,"areas":[{"areaId":2,"areaName":"台江区","areaCode":"350103","enable":true},{"areaId":1,"areaName":"鼓楼区","areaCode":"350102","enable":true}]}
     * createTime : 1492735229000
     * pairTime : null
     * pickUpTime : null
     * finishTime : null
     * requestTime : 1492735224000
     * deliveryTime : 1492742244000
     * item : {"itemId":1,"itemName":"其他","enable":true}
     * objectValue : 100
     * objectWeight : 5
     * tool : {"toolId":3,"toolName":"公共交通","speed":10,"pickTime":0.2,"enable":true}
     * estimateTime : 117
     * estimateMoney : 44.62
     * distance : 17.54
     * carrier : null
     * payType : 1
     * payStatus : 0
     * orderMoney : 44.62
     * freeMoney : 0
     * carryMoney : null
     * carryFee : 0
     * actualMoney : null
     * markUpMoney : 0
     * consignerName : 林杰
     * consignerMobile : 18359928890
     * receiverName : 梁美座
     * receiverMobile : 15659774564
     * consignerLng : 119.315156
     * consignerLat : 26.085234
     * receiverLng : 119.15175
     * receiverLat : 26.143146
     * consignerAddress : 福建省福州市鼓楼区鳌峰坊
     * receiverAddress : 甘蔗镇新区闽江边
     * atOnce : true
     */

    private long orderId;
    private int userId;
    private String remark;
    private String orderNo;
    private int orderStatus;
    private boolean timeOut;
    private CityBean city;
    private long createTime;
    private long pairTime;
    private long pickUpTime;
    private long finishTime;
    private long requestTime;
    private long deliveryTime;
    private ItemBean item;
    private int objectValue;
    private int objectWeight;
    private ToolBean tool;
    private int estimateTime;
    private double estimateMoney;
    private double distance;
    private Object carrier;
    private int payType;
    private int payStatus;
    private double orderMoney;
    private int freeMoney;
    private Object carryMoney;
    private int carryFee;
    private Object actualMoney;
    private BigDecimal markUpMoney;
    private String consignerName;
    private String consignerMobile;
    private String receiverName;
    private String receiverMobile;
    private double consignerLng;
    private double consignerLat;
    private double receiverLng;
    private double receiverLat;
    private String consignerAddress;
    private String receiverAddress;
    private boolean atOnce;
    private String itemName;
    private BigDecimal carrierShowMoney;

    public static OrderBean objectFromData(String str) {

        return new Gson().fromJson(str, OrderBean.class);
    }

    public static List<OrderBean> arrayOrderBeanFromData(String str) {

        Type listType = new TypeToken<ArrayList<OrderBean>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }


    public boolean isTake() {
        return isTake;
    }

    public void setTake(boolean take) {
        isTake = take;
    }

    public long getOrderId() {
        return orderId;
    }

    public void setOrderId(long orderId) {
        this.orderId = orderId;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public int getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(int orderStatus) {
        this.orderStatus = orderStatus;
    }

    public boolean isTimeOut() {
        return timeOut;
    }

    public void setTimeOut(boolean timeOut) {
        this.timeOut = timeOut;
    }

    public CityBean getCity() {
        return city;
    }

    public void setCity(CityBean city) {
        this.city = city;
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    public long getPairTime() {
        return pairTime;
    }

    public void setPairTime(long pairTime) {
        this.pairTime = pairTime;
    }

    public long getPickUpTime() {
        return pickUpTime;
    }

    public void setPickUpTime(long pickUpTime) {
        this.pickUpTime = pickUpTime;
    }

    public long getFinishTime() {
        return finishTime;
    }

    public void setFinishTime(long finishTime) {
        this.finishTime = finishTime;
    }

    public long getRequestTime() {
        return requestTime;
    }

    public void setRequestTime(long requestTime) {
        this.requestTime = requestTime;
    }

    public long getDeliveryTime() {
        return deliveryTime;
    }

    public void setDeliveryTime(long deliveryTime) {
        this.deliveryTime = deliveryTime;
    }

    public ItemBean getItem() {
        return item;
    }

    public void setItem(ItemBean item) {
        this.item = item;
    }

    public int getObjectValue() {
        return objectValue;
    }

    public void setObjectValue(int objectValue) {
        this.objectValue = objectValue;
    }

    public int getObjectWeight() {
        return objectWeight;
    }

    public void setObjectWeight(int objectWeight) {
        this.objectWeight = objectWeight;
    }

    public ToolBean getTool() {
        return tool;
    }

    public void setTool(ToolBean tool) {
        this.tool = tool;
    }

    public int getEstimateTime() {
        return estimateTime;
    }

    public void setEstimateTime(int estimateTime) {
        this.estimateTime = estimateTime;
    }

    public double getEstimateMoney() {
        return estimateMoney;
    }

    public void setEstimateMoney(double estimateMoney) {
        this.estimateMoney = estimateMoney;
    }

    public double getDistance() {
        return distance;
    }

    public void setDistance(double distance) {
        this.distance = distance;
    }

    public Object getCarrier() {
        return carrier;
    }

    public void setCarrier(Object carrier) {
        this.carrier = carrier;
    }

    public int getPayType() {
        return payType;
    }

    public void setPayType(int payType) {
        this.payType = payType;
    }

    public int getPayStatus() {
        return payStatus;
    }

    public void setPayStatus(int payStatus) {
        this.payStatus = payStatus;
    }

    public double getOrderMoney() {
        return orderMoney;
    }

    public void setOrderMoney(double orderMoney) {
        this.orderMoney = orderMoney;
    }

    public int getFreeMoney() {
        return freeMoney;
    }

    public void setFreeMoney(int freeMoney) {
        this.freeMoney = freeMoney;
    }

    public Object getCarryMoney() {
        return carryMoney;
    }

    public void setCarryMoney(Object carryMoney) {
        this.carryMoney = carryMoney;
    }

    public int getCarryFee() {
        return carryFee;
    }

    public void setCarryFee(int carryFee) {
        this.carryFee = carryFee;
    }

    public Object getActualMoney() {
        return actualMoney;
    }

    public void setActualMoney(Object actualMoney) {
        this.actualMoney = actualMoney;
    }

    public BigDecimal getMarkUpMoney() {
        return markUpMoney;
    }

    public void setMarkUpMoney(BigDecimal markUpMoney) {
        this.markUpMoney = markUpMoney;
    }

    public String getConsignerName() {
        return consignerName;
    }

    public void setConsignerName(String consignerName) {
        this.consignerName = consignerName;
    }

    public String getConsignerMobile() {
        return consignerMobile;
    }

    public void setConsignerMobile(String consignerMobile) {
        this.consignerMobile = consignerMobile;
    }

    public String getReceiverName() {
        return receiverName;
    }

    public void setReceiverName(String receiverName) {
        this.receiverName = receiverName;
    }

    public String getReceiverMobile() {
        return receiverMobile;
    }

    public void setReceiverMobile(String receiverMobile) {
        this.receiverMobile = receiverMobile;
    }

    public double getConsignerLng() {
        return consignerLng;
    }

    public void setConsignerLng(double consignerLng) {
        this.consignerLng = consignerLng;
    }

    public double getConsignerLat() {
        return consignerLat;
    }

    public void setConsignerLat(double consignerLat) {
        this.consignerLat = consignerLat;
    }

    public double getReceiverLng() {
        return receiverLng;
    }

    public void setReceiverLng(double receiverLng) {
        this.receiverLng = receiverLng;
    }

    public double getReceiverLat() {
        return receiverLat;
    }

    public void setReceiverLat(double receiverLat) {
        this.receiverLat = receiverLat;
    }

    public String getConsignerAddress() {
        return consignerAddress;
    }

    public void setConsignerAddress(String consignerAddress) {
        this.consignerAddress = consignerAddress;
    }

    public String getReceiverAddress() {
        return receiverAddress;
    }

    public void setReceiverAddress(String receiverAddress) {
        this.receiverAddress = receiverAddress;
    }

    public boolean isAtOnce() {
        return atOnce;
    }

    public void setAtOnce(boolean atOnce) {
        this.atOnce = atOnce;
    }

    public String getItemName() {
        return itemName;
    }

    public void setItemName(String itemName) {
        this.itemName = itemName;
    }

    public BigDecimal getCarrierShowMoney() {
        return carrierShowMoney;
    }

    public void setCarrierShowMoney(BigDecimal carrierShowMoney) {
        this.carrierShowMoney = carrierShowMoney;
    }

    public static class CityBean implements Serializable{
        /**
         * cityId : 1
         * cityName : 福州市
         * cityCode : 3501
         * enable : true
         * areas : [{"areaId":2,"areaName":"台江区","areaCode":"350103","enable":true},{"areaId":1,"areaName":"鼓楼区","areaCode":"350102","enable":true}]
         */

        private int cityId;
        private String cityName;
        private String cityCode;
        private boolean enable;
        private List<AreasBean> areas;

        public static CityBean objectFromData(String str) {

            return new Gson().fromJson(str, CityBean.class);
        }

        public static List<CityBean> arrayCityBeanFromData(String str) {

            Type listType = new TypeToken<ArrayList<CityBean>>() {
            }.getType();

            return new Gson().fromJson(str, listType);
        }

        public int getCityId() {
            return cityId;
        }

        public void setCityId(int cityId) {
            this.cityId = cityId;
        }

        public String getCityName() {
            return cityName;
        }

        public void setCityName(String cityName) {
            this.cityName = cityName;
        }

        public String getCityCode() {
            return cityCode;
        }

        public void setCityCode(String cityCode) {
            this.cityCode = cityCode;
        }

        public boolean isEnable() {
            return enable;
        }

        public void setEnable(boolean enable) {
            this.enable = enable;
        }

        public List<AreasBean> getAreas() {
            return areas;
        }

        public void setAreas(List<AreasBean> areas) {
            this.areas = areas;
        }

        public static class AreasBean {
            /**
             * areaId : 2
             * areaName : 台江区
             * areaCode : 350103
             * enable : true
             */

            private int areaId;
            private String areaName;
            private String areaCode;
            private boolean enable;

            public static AreasBean objectFromData(String str) {

                return new Gson().fromJson(str, AreasBean.class);
            }

            public static List<AreasBean> arrayAreasBeanFromData(String str) {

                Type listType = new TypeToken<ArrayList<AreasBean>>() {
                }.getType();

                return new Gson().fromJson(str, listType);
            }

            public int getAreaId() {
                return areaId;
            }

            public void setAreaId(int areaId) {
                this.areaId = areaId;
            }

            public String getAreaName() {
                return areaName;
            }

            public void setAreaName(String areaName) {
                this.areaName = areaName;
            }

            public String getAreaCode() {
                return areaCode;
            }

            public void setAreaCode(String areaCode) {
                this.areaCode = areaCode;
            }

            public boolean isEnable() {
                return enable;
            }

            public void setEnable(boolean enable) {
                this.enable = enable;
            }
        }
    }

    public static class ItemBean implements Serializable{
        /**
         * itemId : 1
         * itemName : 其他
         * enable : true
         */

        private int itemId;
        private String itemName;
        private boolean enable;

        public static ItemBean objectFromData(String str) {

            return new Gson().fromJson(str, ItemBean.class);
        }

        public static List<ItemBean> arrayItemBeanFromData(String str) {

            Type listType = new TypeToken<ArrayList<ItemBean>>() {
            }.getType();

            return new Gson().fromJson(str, listType);
        }

        public int getItemId() {
            return itemId;
        }

        public void setItemId(int itemId) {
            this.itemId = itemId;
        }

        public String getItemName() {
            return itemName;
        }

        public void setItemName(String itemName) {
            this.itemName = itemName;
        }

        public boolean isEnable() {
            return enable;
        }

        public void setEnable(boolean enable) {
            this.enable = enable;
        }
    }

    public static class ToolBean implements Serializable{
        /**
         * toolId : 3
         * toolName : 公共交通
         * speed : 10
         * pickTime : 0.2
         * enable : true
         */

        private int toolId;
        private String toolName;
        private int speed;
        private double pickTime;
        private boolean enable;

        public static ToolBean objectFromData(String str) {

            return new Gson().fromJson(str, ToolBean.class);
        }

        public static List<ToolBean> arrayToolBeanFromData(String str) {

            Type listType = new TypeToken<ArrayList<ToolBean>>() {
            }.getType();

            return new Gson().fromJson(str, listType);
        }

        public int getToolId() {
            return toolId;
        }

        public void setToolId(int toolId) {
            this.toolId = toolId;
        }

        public String getToolName() {
            return toolName;
        }

        public void setToolName(String toolName) {
            this.toolName = toolName;
        }

        public int getSpeed() {
            return speed;
        }

        public void setSpeed(int speed) {
            this.speed = speed;
        }

        public double getPickTime() {
            return pickTime;
        }

        public void setPickTime(double pickTime) {
            this.pickTime = pickTime;
        }

        public boolean isEnable() {
            return enable;
        }

        public void setEnable(boolean enable) {
            this.enable = enable;
        }
    }
}
